

<form  id="form_upload_${name}" action="/upload" method="post" enctype="multipart/form-data">
                   <input class="easyui-filebox" name="file" data-options="prompt:'Choose a file...'" style="width:45px" accept="image/*">
                   <input type="hidden" id="img_flag" name="flag" value="${img_flag}"/>
                    <input type="submit" value="上传">
                     <img  src="/css/images/loading.gif" id="loadding_${name}"style="display:none" id="loading" />
                    </form>
                    <span id="form_upload_successful_${name}" style="display:none;">
                       <img  id="display_img_${name}" style="widht:60px;height:60px;margin-right:20px;"/>
                        <a href="javascript:void(0)" id="reupload_${name}" class="easyui-linkbutton" style="margin-bottom:26px;" >重新上传</a>
</span>


<script>


     (function() {
             
         
            
            $("#display_img_${name}").click(
            
                function(){
                
                    window.open($(this).attr("src"),"_blank");
                }
            )
            $('#reupload_${name}').click(
            
                function()
                {
                     $('#display_img_${name}').attr("src","");
                       $('#form_upload_${name}').show();
                    $("#form_upload_successful_${name}").hide();
                }
            );
            $('#form_upload_${name}').ajaxForm({
               beforeSend: function(e) {
                    $("#loadding_${name}").show();
               },
                success: function() {
                  
                  //alert(1)
                },
                complete: function(xhr) {
                    
                    var display_area=$("#form_upload_successful_${name}");
                    if(xhr.responseText&&jQuery)
                    {
                      $("#loadding_${name}").hide();
                         var result=jQuery.parseJSON(xhr.responseText);
                         $('#form_upload_${name}').hide();
                         $('#display_img_${name}').attr("src",result.filepath);
                         display_area.show();
                      $("#test").attr("src",result.filepath);
                    }
                    //status.html(xhr.responseText);
                }
            }); 

        })();
 </script>